home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / flatland.scm < prev    next >
Encoding:
Text File  |  2005-06-30  |  2.5 KB  |  75 lines

  1.  
  2. ; The GIMP -- an image manipulation program
  3. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  4. ; FlatLand - creates a tileable pattern that looks like a map
  5. ; Copyright (C) 1997 Adrian Likins
  6. ; This program is free software; you can redistribute it and/or modify
  7. ; it under the terms of the GNU General Public License as published by
  8. ; the Free Software Foundation; either version 2 of the License, or
  9. ; (at your option) any later version.
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. ; GNU General Public License for more details.
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. ;
  19. ; FlatLand 
  20. ;
  21. ;    When used with the Land gradient It produces a tileble pattern that
  22. ;    looks a lot like a map. 
  23. ;
  24. ;    Should be really cool once map-sphere starts working again.
  25. ;
  26. ;    To use: open gradient editor, load the Land gradient then run the script.
  27. ;
  28. ;     Adrian Likins <aklikins@eos.ncsu.edu>
  29. ;
  30.  
  31.  
  32. (define (script-fu-flatland width height seed detail xscale yscale)
  33.   (let* (
  34.      (img (car (gimp-image-new width height RGB)))
  35.      (layer-one (car (gimp-layer-new img width height
  36.                      RGB-IMAGE "bottom" 100 NORMAL-MODE)))
  37.      (layer-two)
  38.     )
  39.  
  40.   (gimp-image-undo-disable img)
  41.   (gimp-image-add-layer img layer-one 0)
  42.  ; (gimp-img-add-layer img layer-two 1)
  43.  
  44.   (plug-in-solid-noise 1 img layer-one 1 0 seed detail xscale yscale )
  45.   (plug-in-c-astretch 1 img layer-one)
  46.   (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
  47.   (gimp-image-add-layer img layer-two -1)
  48.   (gimp-image-set-active-layer img layer-two)
  49.  
  50.   (plug-in-gradmap 1 img layer-two)
  51.   (gimp-image-undo-enable img)
  52.   (gimp-display-new img)
  53. ))
  54.  
  55. (script-fu-register "script-fu-flatland"
  56.             _"_Flatland..."
  57.             "A Land Pattern"
  58.             "Adrian Likins <aklikins@eos.ncsu.edu>"
  59.             "Adrian Likins"
  60.             "1997"
  61.             ""
  62.             SF-ADJUSTMENT _"Image width"  '(256 10 2000 1 10 0 1)
  63.             SF-ADJUSTMENT _"Image height" '(256 10 2000 1 10 0 1)
  64.             SF-ADJUSTMENT _"Random seed"  '(80 1 2000000 1 10 0 1)
  65.             SF-ADJUSTMENT _"Detail level" '(3 1 15 1 10 1 0)
  66.             SF-ADJUSTMENT _"Scale X"      '(4 0.1 16 0.1 2 1 1)
  67.             SF-ADJUSTMENT _"Scale Y"      '(4 0.1 16 0.1 2 1 1))
  68.  
  69. (script-fu-menu-register "script-fu-flatland"
  70.              _"<Toolbox>/Xtns/Script-Fu/Patterns")
  71.